home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / src / const.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-17  |  4.9 KB  |  170 lines

  1. /*
  2.  * This file is part of the portable Forth environment written in ANSI C.
  3.  * Copyright (C) 1995  Dirk Uwe Zoller
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Library General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13.  * See the GNU Library General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Library General Public
  16.  * License along with this library; if not, write to the Free
  17.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  * This file is version 0.9.13 of 17-July-95
  20.  * Check for the latest version of this package via anonymous ftp at
  21.  *    roxi.rz.fht-mannheim.de:/pub/languages/forth/pfe-VERSION.tar.gz
  22.  * or    sunsite.unc.edu:/pub/languages/forth/pfe-VERSION.tar.gz
  23.  * or    ftp.cygnus.com:/pub/forth/pfe-VERSION.tar.gz
  24.  *
  25.  * Please direct any comments via internet to
  26.  *    duz@roxi.rz.fht-mannheim.de.
  27.  * Thank You.
  28.  */
  29. /*
  30.  * const.h ---    lots of constants and other #defines
  31.  * (duz 09Jul93)
  32.  */
  33.  
  34. #ifndef __CONST_H
  35. #define    __CONST_H
  36.  
  37. /* See file options.h for configurable options! */
  38.  
  39. /*
  40.  * Decompiler style. Each 5 comma separated numbers, meaning:
  41.  * additional spaces after print,
  42.  * cr before print, changed indentation for first cr,
  43.  * cr after print, changed indentation for second cr.
  44.  */
  45.  
  46. #define    DEFAULT_STYLE    0, 0,  0,  0,  0
  47. #define    LOCALS_STYLE    0, 0,  0,  1,  0
  48. #define    SEMICOLON_STYLE    0, 0, -4,  0,  0
  49. #define    DOES_STYLE    0, 1, -4,  0,  4
  50.  
  51. #define    IF_STYLE    1, 1,  0,  0,  4
  52. #define    ELSE_STYLE    1, 1, -4,  1,  4
  53. #define    THEN_STYLE    1, 1, -4,  1,  0
  54.  
  55. #define    BEGIN_STYLE    1, 1,  0,  0,  4
  56. #define    WHILE_STYLE    1, 1, -4,  0,  4
  57. #define    REPEAT_STYLE    1, 1, -4,  1,  0
  58. #define    UNTIL_STYLE    1, 1, -4,  1,  0
  59. #define    AGAIN_STYLE    1, 1, -4,  1,  0
  60.  
  61. #define    DO_STYLE    1, 1,  0,  0,  4
  62. #define    LOOP_STYLE    1, 1, -4,  1,  0
  63.  
  64. #define    CASE_STYLE    1, 1,  0,  0,  4
  65. #define    OF_STYLE    1, 1,  0,  0,  4
  66. #define    ENDOF_STYLE    0, 0,  0,  1, -4
  67. #define    ENDCASE_STYLE    0, 1, -4,  1,  0
  68.  
  69.  
  70. /* other constants, do not change! */
  71.  
  72. #define    VERSION        "0.9.13"
  73. #define    DATE        "17-July-95"
  74.  
  75. #undef FALSE
  76. #undef TRUE
  77. #define    FALSE        ((Cell)0)
  78. #define    TRUE        (~FALSE)
  79.  
  80. #define    SMUDGED        0x20    /* these bits are flags in */
  81. #define    IMMEDIATE    0x40    /* the count byte of a definition */
  82.  
  83. #define    TIB_SIZE    0x100    /* size of terminal input buffer */
  84. #define    BPBUF        0x400    /* bytes per block */
  85.  
  86. #define    MAX_LOCALS    (1<<LD_LOCALS)
  87. #define    THREADS        (1<<LD_THREADS)
  88.  
  89. #ifndef PATH_LENGTH        /* suggested by Andrew Houghton */
  90.  
  91. # if defined _POSIX_PATH_MAX
  92. #   define PATH_LENGTH _POSIX_PATH_MAX
  93. # elif defined MAXPATHLEN
  94. #   define PATH_LENGTH MAXPATHLEN
  95. # elif defined MAXNAMLEN
  96. #   define PATH_LENGTH MAXNAMLEN
  97. # elif defined PATH_MAX
  98. #   define PATH_LENGTH PATH_MAX
  99. # else
  100. #   define PATH_LENGTH 256
  101. # endif
  102.  
  103. #endif
  104.  
  105.  
  106. /* Readable macros for magic numbers suggested by spc@pineal.math.fau.edu */
  107.  
  108. #if HIGHBYTE_FIRST
  109. #define    MAKE_MAGIC(A,B,C,D)    ((Cell)A << 24 | (Cell)B << 16 |\
  110.                  (Cell)C <<  8 | (Cell)D)
  111. #else
  112. #define    MAKE_MAGIC(A,B,C,D)    ((Cell)D << 24 | (Cell)C << 16 |\
  113.                  (Cell)B <<  8 | (Cell)A)
  114. #endif
  115.  
  116. #define    SAVE_MAGIC        MAKE_MAGIC('P','F','E','S')
  117. #define    EXCEPTION_MAGIC        MAKE_MAGIC('X','C','P','T')
  118. #define    INPUT_MAGIC        MAKE_MAGIC('S','V','I','N')
  119. #define    DEST_MAGIC        MAKE_MAGIC('D','E','S','T')
  120. #define    ORIG_MAGIC        MAKE_MAGIC('O','R','I','G')
  121. #define    LOOP_MAGIC        MAKE_MAGIC('L','O','O','P')
  122. #define    CASE_MAGIC        MAKE_MAGIC('C','A','S','E')
  123. #define    OF_MAGIC        MAKE_MAGIC('O','F','O','F')
  124. #define SEMANT_MAGIC        MAKE_MAGIC('S','E','M','A')
  125.  
  126. /* THROW codes */
  127.  
  128. #define    THROW_ABORT        -1
  129. #define    THROW_ABORT_QUOTE    -2
  130. #define    THROW_STACK_OVER    -3
  131. #define    THROW_STACK_UNDER    -4
  132. #define    THROW_RSTACK_OVER    -5
  133. #define    THROW_RSTACK_UNDER    -6
  134. #define    THROW_INVALID_MEMORY    -9
  135. #define    THROW_ARG_TYPE        -12
  136. #define    THROW_UNDEFINED        -13
  137. #define    THROW_COMPILE_ONLY    -14
  138. #define    THROW_INVALID_FORGET    -15
  139. #define    THROW_ZERO_NAME        -16
  140. #define    THROW_PICNUM_OVER    -17
  141. #define    THROW_PARSE_OVER    -18
  142. #define    THROW_NAME_TOO_LONG    -19
  143. #define    THROW_UNSUPPORTED    -21
  144. #define    THROW_CONTROL_MISMATCH    -22
  145. #define    THROW_ADDRESS_ALIGNMENT    -23
  146. #define    THROW_USER_INTERRUPT    -28
  147. #define    THROW_COMPILER_NESTING    -29
  148. #define    THROW_INVALID_NAME    -32
  149. #define    THROW_BLOCK_READ    -33
  150. #define    THROW_BLOCK_WRITE    -34
  151. #define    THROW_INVALID_BLOCK    -35
  152. #define    THROW_FILE_ERROR    -37
  153. #define    THROW_FILE_NEX        -38
  154. #define    THROW_UNEXPECTED_EOF    -39
  155. #define    THROW_FSTACK_OVER    -44
  156. #define    THROW_FSTACK_UNDER    -45
  157. #define    THROW_CURRENT_DELETED    -47
  158. #define    THROW_SEARCH_OVER    -49
  159. #define    THROW_SEARCH_UNDER    -50
  160. #define    THROW_FLOATING_POINT    -55
  161. #define    THROW_QUIT        -56
  162. #define    THROW_IF_ELSE        -58
  163.  
  164. #define    THROW_NO_BINARY        -2048
  165. #define    THROW_BIN_TOO_BIG    -2049
  166. #define    THROW_OUT_OF_MEMORY    -2050
  167. #define    THROW_INDEX_RANGE    -2051
  168.  
  169. #endif
  170.